<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>京东的布局方式</title>
    <style>
       
       body
       {
        background-color: #999;
       }
       
        body,
        div {
            padding: 0;
            margin: 0;
        }

        div
        {
            text-align: center;
        }

        a
        {
            text-decoration: none;
            color: #999;
            font-size: 14px;
        }


        .box {
            width: 1190px;
            height: 800px;
            margin: 0 auto;
            margin-top: 20px;
        }
        
        .item {
            width: 230px;
            height: 380px;
            background-color:#fff;
            float: left;
            margin-right: 10px;
        }

        div .content
        {
             margin-right: -10px;
        }

        div .top img
        {
            margin-top: 20px;
            width: 210px;
            height: 200px;
        }
        
        div .bottom .text
        {
            
            overflow: hidden;
            text-overflow:ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            color: #222;
            font-size: 20px;
            margin-top: 10px;
        }

        div .bottom .price
        {
            color: red;
            font-size: 30px;
            position: relative;
            right: 40px;
            top: 20px;
        }

        div .bottom span
        {
            font-size: 20px;
        }


        /* 交集选择器 */
        /* div.last
        {
            margin-right: 0px;
        } */

        /* 伪类选择器 */
        /* 但是使用float选择器是为了兼容，使用伪类就又会造成不兼容的情况 */
        /* div:nth-child(5n)
        {
            margin-right: 0px;
        } */

        /* 增加嵌套设置margin为负数 */
    </style>
</head>

<body>
    <div class="box">
        <div class="content">
            <div class="item"> 
                <div class="top">
                    <a href="#"><img src="../image/jd01.jpg" alt="图片"></a>
                </div>
                <div class="bottom">
                    <div> <a href="#" class="text">小天鹅（LittleSwan）10公斤滚筒全自动洗衣机家用水魔方冷水洗智投UDC净泡洗触控屏
                         家电国家补贴TG100VT8M20IT</a></div>
                    <div> <a href="#" class="price">¥2599. <span>00</span></a></div>
                </div>
            </div>
        <div class="content">
            <div class="item"> 
                <div class="top">
                    <a href="#"><img src="../image/jd01.jpg" alt="图片"></a>
                </div>
                <div class="bottom">
                    <div> <a href="#" class="text">小天鹅（LittleSwan）10公斤滚筒全自动洗衣机家用水魔方冷水洗智投UDC净泡洗触控屏
                         家电国家补贴TG100VT8M20IT</a></div>
                    <div> <a href="#" class="price">¥2599. <span>00</span></a></div>
                </div>
            </div>
        <div class="content">
            <div class="item"> 
                <div class="top">
                    <a href="#"><img src="../image/jd01.jpg" alt="图片"></a>
                </div>
                <div class="bottom">
                    <div> <a href="#" class="text">小天鹅（LittleSwan）10公斤滚筒全自动洗衣机家用水魔方冷水洗智投UDC净泡洗触控屏
                         家电国家补贴TG100VT8M20IT</a></div>
                    <div> <a href="#" class="price">¥2599. <span>00</span></a></div>
                </div>
            </div>
        <div class="content">
            <div class="item"> 
                <div class="top">
                    <a href="#"><img src="../image/jd01.jpg" alt="图片"></a>
                </div>
                <div class="bottom">
                    <div> <a href="#" class="text">小天鹅（LittleSwan）10公斤滚筒全自动洗衣机家用水魔方冷水洗智投UDC净泡洗触控屏
                         家电国家补贴TG100VT8M20IT</a></div>
                    <div> <a href="#" class="price">¥2599. <span>00</span></a></div>
                </div>
            </div>
        <div class="content">
            <div class="item"> 
                <div class="top">
                    <a href="#"><img src="../image/jd01.jpg" alt="图片"></a>
                </div>
                <div class="bottom">
                    <div> <a href="#" class="text">小天鹅（LittleSwan）10公斤滚筒全自动洗衣机家用水魔方冷水洗智投UDC净泡洗触控屏
                         家电国家补贴TG100VT8M20IT</a></div>
                    <div> <a href="#" class="price">¥2599. <span>00</span></a></div>
                </div>
            </div>
             
        </div>
    </div>
</body>

</html>